<?php

class UserController extends CController
{
	public function actions()
	{
		return array(
			'login'=>'application.controllers.user.LoginAction',
			'logout'=>'application.controllers.user.LogoutAction',
			'register'=>'application.controllers.user.RegisterAction',
            'checkName'=>'application.controllers.user.CheckNameAction',
            'show'=>'application.controllers.user.ShowAction',
            'listRecipe'=>'application.controllers.user.ListRecipeAction',
		);
	}

	public function filters()
	{
		return array(
			'accessControl',
		);
	}

	public function accessRules()
	{
		return array(
            array('allow',
                'actions'=>array('logout','show','listRecipe','checkName'),
                'users'=>array('*'),        
            ),
			array('allow',
				'actions'=>array('register','login'),
				'users'=>array('?'),
			),
			array('deny',
				'users'=>array('*'),
			),
		);
	}
}
